package com.shushan.receiver;

import android.app.admin.DeviceAdminReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

/**
 * @ClassName: LockAdminReceiver
 * @Desciption: 设备管理器激活广播接收器
 * @author: yichaohua
 * @date: 2018-05-28
 */
public class LockAdminReceiver extends DeviceAdminReceiver {

    private static final String TAG = "LockAdminReceiver";

    @Override
    public void onEnabled(Context context, Intent intent) {
        super.onEnabled(context, intent);

        Log.i(TAG,"onEnabled()");

//        DevicePolicyManager dpm = (DevicePolicyManager) context.getSystemService(DEVICE_POLICY_SERVICE);
//        dpm.lockNow();
    }

    @Override
    public void onDisabled(Context context, Intent intent) {
        super.onDisabled(context, intent);

        Log.i(TAG,"onDisabled()");
    }

    @Override
    public void onReceive(Context context, Intent intent) {
        super.onReceive(context, intent);

        Log.i(TAG,"onReceive()");
    }
}
